
#ifndef CardMemPrivate_h__
#define CardMemPrivate_h__

#include "CardDefine.h"
#include "CardPrivate.h"

struct MemCardOpsTag {
	int(*probe)(Card_T*);
	int(*activate)(Card_T*);
	int(*deactivate)(Card_T*);
	int(*setup)(Card_T* card, void* param);
	int(*authen)(Card_T* card, void* param, uint8_t *key, uint8_t klen);
	int(*read)(Card_T* card, uint32_t address, uint8_t* buf, uint16_t len);
	int(*write)(Card_T* card, uint32_t address, uint8_t* buf, uint16_t len);
	int(*check)(Card_T* card);
	int(*control)(Card_T* card, uint8_t op, void* param, void*cbuf, uint16_t clen, void* rbuf, uint16_t* rlen);
};

struct MifareInfoTag {
	uint8_t uid[8];
	uint8_t ulen;
// 	uint8_t sector;
};

struct MemCardTag {
	Card_T base;
	void* context;
};

typedef struct {
	uint8_t keyType;
	uint8_t block;
	uint8_t uid[4];
	uint8_t keys[6];
}MfAuthParam_T;

#endif // CardMemPrivate_h__
